//
// Created by xili on 2024/7/30 21:05.
// Go big or go home.
//
#include <iostream>
#include <unordered_map>

using namespace std;

class Solution {
public:
    bool judgeCircle(string moves) {
        int cR = 0;
        int cU = 0;
        for (auto &item: moves) {
            if (item == 'R')cR++;
            else if (item == 'L')cR--;
            else if (item == 'U')cU++;
            else cU--;
        }
        return cR == 0 && cU == 0;
    }
};